The ListSheet is the workhorse of a selection page. It displays a selectable list in a number of formats, as well as enabling paging and sorting. Columns are displayed in the order that they are specified in the meta-data.
Event log:
| onError |
fires on error (when m_bDebug = true in HTC, shows alert as well)
event object propertieswindow.event.error String. Returns error detail. |
| OnRowSelect |
fires when a row selected
event object propertieswindow.event.XMLrecord XMLNode. The XML <record> node for the selected row |
| OnRowUnselect |
fires when a row unselected
event object propertieswindow.event.XMLrecord XMLNode. The XML <record> node for the unselected row |
| OnAllRowsSelect |
| fires when all rows selected |
| OnAllRowsUnselect |
| fires when all rows unselected |
| OnGroupOpen |
fires when a group row opened
event object propertieswindow.event.XMLrecord XMLNode. The XML <record> node for the opened group row |
| OnHeaderClick |
fires when column header is clicked
event object properties
window.event.sortcol String. The column id for the column whose header was clicked
|
| OnNewPage |
|
fires when back or next buttons clicked or page number changed
window.event.page Positive integer. The page number to display |
| elListSheet.selectAllRows() |
selects all rows
parametersnone return valuenone |
| elListSheet.unselectAllRows() |
unselects all rows
parametersnone return valuenone |
| bSuccess = elListSheet.reload(sOp, sArgs) |
reloads the list using an operation configured in meta-xml. Note that explicit calls to reload
will automatically unselect all items in the list. When 'page' and 'sort' operations are done internally
unselect is not called. Usually, you will want to also reset the page
number to 1 for multipage lists when calling reload.
parameterssOp is an operation child node name in meta-xml. The child nodes' id corresponds to a form in the document whose ACTION = the post page and whose elements will be sent along with any other arguments below sArgs is a list of URL-encoded page arguments to pass to the post page. Note: arguments sent by default: "op", "page" (for "newpage" op), "column" and "direction" (for sort op), "xmlrecord" (for sublist op) return valueBoolean. Represents success. True = document retreived, with no errors and at least one record. |
| DataXML |
xml data (from a recordset) data-island id. Usually in the format:
<document> <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... </record> ... </document>Hierarchical lists have data in either a 2-teir format: <document> <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... </record> </record> ... </document>... or a 3-teir format: <document> <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... </record> </record> </record> ... </document> |
| MetaXML | xml meta-data data-island id |
| set xmlList = elListSheet.XMLlist |
| Read-only. XML document node containing the list. Each row is in a child <record> node containing a sub-node for eachy field/column. Select columns return two sub-nodes; one with the name of the column containing the underlying value and one named colid_displayvalue containing the display name for that value. |
|
bValue = elListSheet.page
elListSheet.page = bValue |
| Read-write. Gets or sets current page number in page controls. Note: setting page does not fire the onNewPage event or fetch a new list. |
|
bValue = elListSheet.recordcount
elListSheet.recordcount = bValue |
| Read-write. Gets or sets current recordcount and recalculates page controls. Setting recordcount to -1 displays page controls with last page button disabled. setting to 0 (zero) will hide the page controls |
<xml id='lsMeta'>
<listsheet>
<global curpage='2' pagesize='20' recordcount='4387' selection='multi' />
<columns>
<column id='id' id2='id' hide='yes'></column>
<column id='name' id2='type' sortdir='asc' width='25'>Name</column>
<column id='events' id2='events' width='15'>Events</column>
<column id='requests' id2='requests' width='15'>Requests</column>
<column id='clicks' id2='clicks' width='15'>Clicks</column>
<column id='clickpercent' id2='clickpercent' width='15' format='float'>Click %</column>
<column id='sold' id2='sold' width='15' format='float'>Sold</column>
</columns>
<operations>
<newpage formid='newpageform'/>
</operations>
</listsheet>
</xml>